
<?php
/*
 * date:2016 08 01
 * author:by di
 * 构造yafconf
 * 自由开发，不受环境限制
 */
class myconf{
    public $hostname      = "192.168.10.249";
    public $username      = "root";
    public $password      = "de8GvDza";
    public $port          = "3306";
    public $database      = "shengshijinxiang";
    public $charset       = "utf8";
    public $debug         = 1;
    public $type          = "mysql";
    public $pconnect      = 0;
    public $autoconnect   = 0;
}
if(PATH_SEPARATOR==':'){//linux
    //使用内置yafconf
}else{//win
    //构造yafconf
    class Yaconf{
        static function get(){
            $e=(array)new myconf();
            foreach($e as $k=>$v){
                if( gettype($v)=='resource' ) return;
                if( gettype($v)=='object' || gettype($v)=='array' )
                    $e[$k]=(array)objectToArray($v);
            }
            $m['m']=$e;
            // print_r($m);
            return $m;
        }
    }
}

//Array ( [hostname] => 192.168.10.249 [username] => root [password] => de8GvDza [database] => shengshijinxiang [type] => mysql [charset] => utf8 [debug] => 1 [pconnect] => 0 [autoconnect] => 0 )
?>